define(function (require, exports, module) {

    var CommentAnnotToolHandler = require("./CommentAnnotToolHandler.js");
    var CommentAnnotHandler = require("./CommentAnnotHandler.js");
    require("./AnnotHandleManager.js");
    
    WebPDF.CommentAnnotPlugin = function (pReaderApp,annotPlugin) {
        var _readerApp = pReaderApp,
        	   _pAnnotPlugin = annotPlugin,
              //_Language = _readerApp.getLanguage(),
        	  _annotHandlerArray = [],
              _self = this;

        this.getPluginName = function () {
        	return "CommentAnnot";
        };
        this.onRegister = function () {

        };
        this.init = function () {
            //Add Annotation handler
            var pAnnotHandler = null;
            pAnnotHandler = new CommentAnnotHandler(_readerApp, WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_UNDERLINE, "Underline tool", _self);
            _pAnnotPlugin.registerAnnotHandler(pAnnotHandler);
            _annotHandlerArray.push(pAnnotHandler);

            pAnnotHandler = new CommentAnnotHandler(_readerApp, WebPDF.PDFData.CommentAnnotType.COMMENTTYPE_HIGHLIGHT, "Highlight tool", _self);
            _pAnnotPlugin.registerAnnotHandler(pAnnotHandler);
            _annotHandlerArray.push(pAnnotHandler);
            
            
        };
        this.unload = function () {
        };

        this.getReaderApp = function () {
            return _readerApp;
        };
    };

    exports.createPlugin = function (readerApp) {
    	var annotPlugin = readerApp.getPluginByName(WebPDF.BASEANNOT_PLUGIN_NAME);
        var commentAnnotPlugin = new WebPDF.CommentAnnotPlugin(readerApp,annotPlugin);
        return commentAnnotPlugin;
    };

});